<!DOCTYPE html>
<script src="resources/password-echo.js"></script>
<script>
onload = function() {
  testRunner.dumpAsText();
  internals.settings.setPasswordEchoEnabled(false);
  var testnode = document.getElementById('testnode');
  setTestNode(testnode);

  testnode.value = 'test';
  assert(true, window.find(secureText(testnode.value.length)), "secured by default.");

  window.getSelection().removeAllRanges();
  internals.setShouldRevealPassword(testnode, true);
  assert(true, window.find(testnode.value), "properly revealed");

  window.getSelection().removeAllRanges();
  internals.setShouldRevealPassword(testnode, false);
  assert(true, window.find(secureText(testnode.value.length)), "hidden again");
}
</script>

<p>Tests that passwords are revealed by calling setShouldRevealPassword()
<input type="password" id="testnode">
<ul id="console"></ul>
